package baiwa.rta.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import baiwa.rta.dao.RoleDao;
import baiwa.rta.model.DataTableModel;
import baiwa.rta.model.Role;
import baiwa.rta.service.RoleService;

@Service("RoleService")
@Transactional(readOnly = false)
public class RoleServiceImpl implements RoleService {

	@Autowired RoleDao dao;

	@Override
	@Transactional(readOnly = true)
	public Role findById(Integer id) {
		return dao.findById(id);
	}

	@Override
	public DataTableModel<Role> getRoleDataTable(Role role, int iDisplayStart,
			int iDisplayLength) {
		return dao.findRoleDataTable(role, iDisplayStart,
				iDisplayLength);
	}

    @Override
    @Transactional
    public void save(Role role) {
        dao.create(role);
    }

    @Override
    @Transactional
    public void update(Role role) {
        dao.update(role);
    }

    @Override
    @Transactional
    public void delete(Role role) {
        dao.delete(role);
    }
    
}
